import { UseInterceptors } from '@nestjs/common';
import {
  MessageBody,
  SubscribeMessage,
  WebSocketGateway,
  WebSocketServer,
} from '@nestjs/websockets';
import { Server } from 'socket.io';
import { ResponseInterceptor } from 'src/interceptors/response.interceptor';
import { CreateOrderDto } from './dto/create-order.dto';

@UseInterceptors(ResponseInterceptor)
@WebSocketGateway(9090, { cors: true, namespace: 'order' })
export class OrderGateway {
  @WebSocketServer()
  server: Server;
  @SubscribeMessage('init')
  toInit(@MessageBody() createOrderDto: CreateOrderDto): any {}
}
